home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / falcon / programm.ing / nt_dsp1.lzh / NT_DSP1.MSA / FFT / FFTR2CN.HLP < prev    next >
Text File  |  1990-01-17  |  3KB  |  45 lines

  1.          Name: FFTR2CN.ASM
  2.          Type: Assembler Macro
  3.       Version: 1.0
  4.   Last Change:  18-Aug-88
  5.  
  6.   Description: Radix 2, Decimation-in-time Complex FFT Macro with normally
  7.                ordered input and output
  8.  
  9.  This macro performs a complete Fast Fourier Transform (FFT) on complex
  10.  data.  The basic algorithm is the Decimation-in-time (DIT), Radix 2
  11.  FFT algorithm using 24 bit fixed-point arithmetic.  The algorithm uses
  12.  a sine-cosine lookup table for the FFT coefficients (twiddle factors).
  13.  FFTR2CN can be called to perform any FFT from 16-32768 points.  Simply
  14.  call it with the arguments of number of FFT points, location of the
  15.  data array and location of the sine-cosine table.  All register
  16.  initialization is performed by this macro.  However, the macro assumes
  17.  that registers which should not be altered by the FFT have already been
  18.  saved by the main program.  This allows the user to fit the FFT macro
  19.  into his application and thus control the context switching overhead.
  20.  No data scaling is performed and no overflow detection is done.
  21.  Modifications to this routine could allow it to be used with the
  22.  scaling modes and thus allow dynamic scaling for each FFT pass.
  23.  
  24.  All data and coefficients are complex, with the real part in X Data
  25.  memory and the imaginary part in Y Data memory.  For an N point FFT,
  26.  the data buffer requires N X Data and N Y Data memory locations.
  27.  The algorithm is not performed "in-place", meaning that different data
  28.  buffers are required for input and output data.  The input
  29.  data is assumed to be in normal (time-sequential) order and the
  30.  output is also in normal order.   
  31.  
  32.  The FFTR2CN macro uses "twiddle factors" (-cosine and -sine tables)
  33.  stored in data memory.  For maximum speed, the FFT macro performs
  34.  a lookup table operation to get new sine and cosine values for
  35.  each group of butterflies.  A SINCOS macro is available to
  36.  generate these tables.  For an N point FFT, N/2 X Data and N/2
  37.  Y Data locations are required.  Sine and cosine values could be
  38.  calculated in real-time to save data memory at the expense of
  39.  execution time.
  40.  
  41.  The FFTR2CN macro is identical to the FFTR2C macro except for the storage
  42.  of the output data. Using the reverse-carry address modifier and a 
  43.  separate output data buffer, the output data is stored in normal order. The
  44.  FFTR2CN macro can directly replace the FFTR2C macro if "odata", the output 
  45.  buffer starting address is specified and included in the call.^Z